package com.xxxy.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xxxy.blockHandler.LimitFlowBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/limitFlow")
public class LimitFlowController {
    @GetMapping(value = "/direct")
    @SentinelResource(value = "directResource", blockHandler = "directBlockHandler",
            blockHandlerClass = LimitFlowBlockHandler.class)
    public String direct() {
        return "我是直连接口";
    }

    @GetMapping("/associate")
    public String associate() {
        return "我是关联接口";
    }
}
